import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom'
import { poemRouters } from './routes/index'
import Frame from './components/frame/index'


function App() {
  return (
    <Frame>
      <Switch>
        {poemRouters.map(route => {
          return (
            <Route key={route.path} 
            path={route.path} 
            exact={route.exact} 
            render={routeProps => {
              return <route.component {...routeProps} />;
          }}
          />
          );
        })}
      </Switch>
    </Frame>
  );
}

export default App;
